package com.njym.java.security.app.biz;

import com.njym.java.security.app.entity.PhotoAlbum;
import com.njym.java.security.app.entity.PhotoAlbumVo;
import com.njym.java.security.app.mapper.PhotoAlbumMapper;
import com.njym.java.security.common.biz.BaseBiz;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 
 *
 * @author lijie
 * @email 717057076@qq.com
 * @date 2019-11-25 10:28:11
 */
@Service
public class PhotoAlbumBiz extends BaseBiz<PhotoAlbumMapper,PhotoAlbum> {

    @Resource
    private PhotoAlbumMapper photoAlbumMapper;

//    @Cache(key="photoAlbumMapper")
    public List<PhotoAlbumVo> selectLists(int userId){
        List<PhotoAlbumVo> list =  photoAlbumMapper.selectLists(userId);
        return list;
    }

    public List<PhotoAlbumVo> getOpenAlbums(int userId){
        List<PhotoAlbumVo> list =  photoAlbumMapper.getOpenAlbums(userId);
        return list;
    }

//    @Cache(key="photoAlbumMapper")
    public void updateName(String photoName, int id, int userId){
        photoAlbumMapper.updateName(photoName, id, userId);
    }

    public void deleteAlbum(int id, int userId) { photoAlbumMapper.deleteAlbum(id, userId); }
}